<%@ include file="./jsp/common.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>

    
    <title>SSI</title>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8"> 
	<script type="text/javascript" src="./js/jquery-1.4.4.min.js"></script>
	<script type="text/javascript" src="./js/common.js"></script>
	<script type="text/javascript">
	function queryActivitySpread(){
			$.ajax({
				   type: "POST",
				   url: getPath()+"index/queryActivitySpread.do",
				   data:null,
				   success: function(data, textStatus){
				     var content=eval('('+data+')');
						
				var str="";
				for(var i=0;i<content.length;i++){
					str+="<img  src=\""+content[i].goodsImgUrl+"\"></br>";
					}
				$("#queryActivitySpread").html(str);	 
				   },
				   error:function(XMLHttpRequest, textStatus, errorThrown){
					   alert(errorThrown);
					   }
				});	
			} 
	function login(){
		var username=$("#username").val();
		var password=$("#password").val();
		if(username==""||password==""){
		alert("用户名或密码为空！");
		return;
			}
		
		$.ajax({
			   type: "POST",
			   url: path+"user/login.do",
			   data:{"user.username":username,"user.password":password},
			   success: function(root){
			     var root=eval('('+root+')');
			 	
			 	if(undefined!=root.error){
			 		var str=$("#login");
			 		str.append(root.error);
			 		
				 	}else{		
				 	
				 		$("#login").html("欢迎"+root.username+"登陆！      "+"<a href=\""+path+"user/user_entryManger.do\" target=\"_blank\">进入后台管理</a>"+"<a href=\""+path+"logout\">注销</a>");
					}
			   }
			});


		}
	</script>

	<style type="text/css">
td{
text-align: center;
width: auto;
}
body{
background-color: CCFFCC;
}

</style>
  </head>
  
  <body>
  <center>
 <input type="button" name="login" value="查询" onclick="queryActivitySpread();">
 </center>
   <div id="login" style="top:0px;height: 30px;width: 100%;right: 0px;text-align: right;">
 用户名：<input type="text" id="username" name="user.username" style="width: 150px;">
密码：  <input type="password" id="password" name="user.password" style="width: 150px;">
     <input type="button" name="login" value="登陆" onclick="login();">
  </div> 
 <div id="queryActivitySpread">
 <img alt="" src="">
 </div>
  </body>
</html>
